<template>
    <Layout>
        <Form ref="form1" :model="dataToQuery" :label-width="120">
            <Row class="query-form">
                <Col span="8">
                    <FormItem label='问题类别：' prop='problemCategory'>
                        <Select v-model="dataToQuery.problemCategory">
                            <Option v-for="item in environmentProtectionList" :value="item.codingCodeId"
                                    :key="item.codingCodeId">{{ item.codingName }}
                            </Option>
                        </Select>
                    </FormItem>
                </Col>
                <Col span="8">
                    <FormItem label="当前状态：" prop="order">
                        <Select v-model='dataToQuery.state' clearable class='query-form-el'>
                            <Option value="START">整改中</Option>
                            <Option value="DELAY">延期</Option>
                            <Option value="OPEN">完成</Option>
                        </Select>
                    </FormItem>
                </Col>
                <Col span="8" v-if="!switchFlag">
                    <Button @click="switchQuery(true)" class="ivu-btn-switch" type="text">展开∨</Button>
                    <Button @click="reset" class="ivu-btn-reset">重置</Button>
                    <Button type="primary" class="ivu-btn-query" icon="md-search" @click="query">查询</Button>
                </Col>
                <Col span="8"  v-else>
                    <FormItem label="督办：" >
                        <Select v-model='dataToQuery.grading' clearable class='query-form-el'>
                            <Option value="FOCUS_ON">重点关注</Option>
                            <Option value="FOLLOW">关注</Option>
                            <Option value="NO_FOLLOW">未关注</Option>
                        </Select>
                    </FormItem>
                </Col>
            </Row>
            <Row v-show="switchFlag" class="query-form">
                <Col span="8" offset="16">
                    <Button @click="switchQuery(false)" class="ivu-btn-switch" type="text">收起∧</Button>
                    <Button @click="reset" class="ivu-btn-reset">重置</Button>
                    <Button class="ivu-btn-query" icon="md-search" @click="query">查询</Button>
                </Col>
            </Row>
            <Row class="query-form">
                <Col span="24">
                    <!--<Button type="primary" class="ivu-btn-add" icon="md-cloud-download" @click="exportFormSubmit">导出</Button>-->
                    <Button size="large" class="ivu-btn-add" icon="md-home" @click="goBack">返回</Button>
                </Col>
            </Row>
        </Form>
        <Table ref='table' :height="tableHeight+15" no-data-text="没有查询到相关数据!" @on-selection-change='getSelectRows'
               :loading='pageStatus.loading' border :columns="columns1" :data="dataTable" @on-expand="onExpand">
        </Table>
        <!--<Row style="margin-right:10px;">-->
            <!--<Col span="24">-->
                <!--<Page style="float: right" :total="pagedata.total" :page-size="pagedata.pageSize" @on-change="pageChange" @on-page-size-change="pageSizeChange" :page-size-opts="pageSizeArray" show-total show-sizer show-elevator/>-->
            <!--</Col>-->
        <!--</Row>-->

        <Modal :title="mode === 'view'?'环保问题详情':'整改进展'" :transfer=false :mask-closable="false" v-model="dialogShow" v-if="dataToView && dialogShow" :width=800 class-name='limit-height-dialog'>
            <Row>
                <Col span="24">
                    <Form ref="dialogForm" :class="mode === 'view'?'modal-view-detail':''" :show-message="false" :model="dataToView" :rules="mode === 'view'?{}:ruleCustom" :label-width="100" :label-position="right">
                        <Row type="flex" justify="space-around" class="code-row-bg">
                            <Col span="11">
                                <FormItem label='评价项目：' prop='project'>
                                    <div>{{ dataToView.project }}</div>
                                </FormItem>
                            </Col>
                            <Col span="11">
                                <FormItem label='问题类别：' prop='problemCategoryName'>
                                    <div>{{ dataToView.problemCategoryName }}</div>
                                </FormItem>
                            </Col>
                        </Row>
                        <Row type="flex" justify="space-around" class="code-row-bg">
                            <Col span="23">
                                <FormItem label='评价内容：' prop='problemSourceDesc'>
                                    <div>{{ dataToView.content }}</div>
                                </FormItem>
                            </Col>
                        </Row>
                        <Row type="flex" justify="space-around" class="code-row-bg">
                            <Col span="23">
                                <FormItem label='评分标准：' prop='standard'>
                                    <div>{{ dataToView.standard }}</div>
                                </FormItem>
                            </Col>
                        </Row>
                        <Row type="flex" justify="space-around" class="code-row-bg">
                            <Col span="23">
                                <FormItem label='问题描述：' prop='problemDesc'>
                                    <div>{{ dataToView.problemDesc }}</div>
                                </FormItem>
                            </Col>
                        </Row>
                        <Row type="flex" justify="space-around" class="code-row-bg">
                            <Col span="11">
                                <FormItem label='检查时间：' prop='checkTime'>
                                    <div>{{renderViewDate( dataToView.checkTime) }}</div>
                                </FormItem>
                            </Col>
                            <Col span="11">
                                <FormItem label='完成时限：' prop='completeTime'>
                                    <div>{{renderViewDate( dataToView.completeTime) }}</div>
                                </FormItem>
                            </Col>
                        </Row>
                        <Row type="flex" justify="space-around" class="code-row-bg">
                            <Col span="11">
                                <FormItem label="整改状态：" prop="state">
                                    <Select v-model='dataToView.state' :clearable="false" class='query-form-el'>
                                        <Option value="START">整改中</Option>
                                        <!--<Option value="DELAY">延期</Option>-->
                                        <Option value="OPEN">已完成</Option>
                                        <Option value="DELAY" disabled>延期</Option>
                                    </Select>
                                </FormItem>
                            </Col>
                            <Col span="11">
                                <FormItem label='整改人：' prop='rectifyUserId'>
                                    <!--<div>{{ dataToView.rectifyUserName }}</div>-->
                                    <userDom ref="userDom" :selectData='setCurrentUserName' :placeholderStr="'请选择整改人'"
                                             :singleChoice=true :ifUser="true" :rootOrgName="dataToView.companyName"
                                             @setData = '(data)=>{ if(data){this.$set(dataToView, "rectifyUserId", data.userId),this.$set(dataToView, "rectifyUserName", data.userName)}}'></userDom>
                                </FormItem>
                            </Col>
                        </Row>
                        <Row  type="flex" justify="space-around" class="code-row-bg">
                            <Col span="23">
                                <FormItem label='整改方案：' prop='rectifyPlan'>
                                    <Input class='' placeholder="请填写整改方案" type="textarea"
                                           :autosize="{minRows:2,maxRows:5}" v-model='dataToView.rectifyPlan'></Input>
                                </FormItem>
                            </Col>
                        </Row>
                        <Row  type="flex" justify="space-around" class="code-row-bg">
                            <Col span="23">
                                <FormItem label="整改附件：">
                                    <div>
                                        <Upload ref="upload"
                                                :before-upload="(file) => { beforeUpload1(file, 'id','EnQuestionDetailForApproval') }"
                                                :show-upload-list="true"
                                                :max-size="10240"
                                                multiple
                                                type="drag"
                                                :action="fileUrl">
                                            <div style="padding: 10px">
                                                <Icon type="ios-cloud-upload" size="45" style="color: #3399ff"></Icon>
                                                <p>点击将文件拖拽到这里上传</p>
                                                <span style="font-size:8px;color: #797a64">支持扩展名：.rar .zip .doc .docx .pdf...</span>
                                            </div>
                                        </Upload>
                                    </div>
                                    <div v-show="dataToView.idFiles.length>0" v-for="(item,index) in dataToView.idFiles" :key='index'>
                                        <a @click="downloadFiles(item,index)">{{ item.fileName }}</a>
                                        <Button type="text" icon="md-trash" @click="removeFile1(item.id, 'id','EnQuestionDetailForApproval')" style="margin-left: 5px;margin-bottom: 3px"/>
                                        <Progress  v-show="uploadListVisible[index]" :percent="uploadListPercent[index]"></Progress>
                                    </div>
                                </FormItem>
                            </Col>
                        </Row>
                        <Row type="flex" justify="space-around" class="code-row-bg">
                            <Col span="23">
                              <FormItem label='当前进展描述：' prop='completion'>
                                <Input class='' placeholder="当前进展描述" type='textarea' :autosize="{minRows:2,maxRows:5}"
                                       v-model='dataToView.completion'></Input>
                              </FormItem>
                            </Col>
                        </Row>
                    </Form>
                </Col>
            </Row>
            <div slot="footer">
                <Button v-if="mode != 'view'" type="primary" class='ivu-btn-save' @click="submit('dialogForm')">确定
                </Button>
                <Button v-if="mode != 'view'" type="primary" class='ivu-btn-cancel' @click="handleCancel">取消</Button>
                <Button v-if="mode === 'view'" class='ivu-btn-save' @click="dialogShow=false">关闭</Button>
            </div>
        </Modal>

        <Modal :title="mode==='edit'?'督办问题进展修改':'督办问题进展新增'" :transfer=false :mask-closable="false" v-model="model2" :width=700 @on-cancel="model2 = false,questionProgress={}">
            <Row>
                <Col span="24">
                    <Form ref="dialogForm1" :show-message="false" :model="questionProgress" :rules="ruleCustom1" :label-width="120" :label-position="top">
                        <Row type="flex" justify="space-around" class="code-row-bg">
                            <Col span="23">
                                <FormItem label='进展说明：' prop='progressDesc'>
                                    <Input class='query-form-el' placeholder="请填写进展说明" type='textarea' :autosize="{minRows:2,maxRows:5}" v-model='questionProgress.progressDesc'></Input>
                                </FormItem>
                            </Col>
                        </Row>
                        <Row type="flex" justify="space-around" class="code-row-bg">
                            <Col span="23">
                                <FormItem label='下一步计划：' prop='planDesc'>
                                    <Input class='query-form-el' placeholder="请填写下一步计划" type='textarea' :autosize="{minRows:2,maxRows:5}" v-model='questionProgress.planDesc'></Input>
                                </FormItem>
                            </Col>
                        </Row>
                    </Form>
                </Col>
            </Row>
            <div slot="footer">
                <Button v-if="mode != 'view'" type="primary" class='ivu-btn-save' @click="submit1('dialogForm1')">确定</Button>
                <Button v-if="mode != 'view'" type="primary" class='ivu-btn-cancel' @click="model2 = false,questionProgress={}">取消</Button>
                <Button v-if="mode === 'view'" class='ivu-btn-save' @click="model2 = false,questionProgress={}">关闭</Button>
            </div>
        </Modal>


        <Modal title="问题延期" :transfer=false v-model="modal4"  :width=700 class-name='limit-height-dialog'
               :styles="{height:'400px',top: '20px'}">
            <Form ref="extensionForm" :model="dataToExtension"  :rules="extensionShow" class="rpt-form"
                  :show-message="false" label-position="top">
                <Row type="flex" justify="space-around" class="code-row-bg" >
                    <Col span="11">
                        <FormItem label="延期时间：" prop="completeTime">
                            <DatePicker  type="date" placeholder="请选择日期" style="width: 100%"
                                         v-model='dataToExtension.completeTime' :options="options"
                                         editable='false' ></DatePicker>
                        </FormItem>
                    </Col>
                    <Col span="11">
                        <FormItem label="审批人：" prop="userId">
                            <Input type="text"  v-model="dataToExtension.userName" @on-focus="modal5 = true" readonly  suffix="ios-search"/>
                        </FormItem>
                    </Col>
                </Row>
                <Row type="flex" justify="space-around" class="code-row-bg">
                    <Col span="23">
                        <FormItem label='延期说明：' prop='explain'>
                            <Input class='' type='textarea' v-model='dataToExtension.explain'></Input>
                        </FormItem>
                    </Col>
                </Row>

            </Form>
            <div slot="footer">
                <Button  type="primary" class='ivu-btn-save' :loading="loadingExtension" @click="submitExtension('extensionForm')">确定</Button>
                <Button  type="primary" class='ivu-btn-cancel' @click="modal4=false">取消</Button>
            </div>
        </Modal>

        <Modal :transfer=false footer-hide v-model="modal5" :width=900>
            <userManager :model="true" :companyId="-1" @getSelectModelData="getSelectModelData">
            </userManager>
        </Modal>
    </Layout>
</template>

<script>
    import pageCommonFunction from '@/components/pageCommonFunction.js'
    import {sessionStorage} from '@/common/cacheUtils.js'
    import {Api} from "@/api";
    import userDom from "@/components/input-user.vue";
    import userManager from '../../base/authorityManager/userManager'
    export default {
        components: {userDom,userManager},
        data() {
            return {
                ...this.createCommonDataField(),
                environmentProtectionList: [],
                modal3: false,
                columns1: [
                    {type:'expand', width:30,
                        fixed: 'left',
                        _disableExpand:true,
                        render:(h,params)=>{
                            return h('Table',{
                                props: {
                                    columns: [
                                        {title: '操作', key: 'action', width: 100, align: 'center',fixed: 'left',
                                            render: (h, params) => {
                                                return h('div', [
                                                    h('A', {
                                                        props: {type: 'primary', size: 'small'},
                                                        style: {fontSize: '14px'},
                                                        on: {
                                                            click: () => {
                                                                this.questionProgress={...params.row}
                                                                this.model2 =true
                                                                this.mode= 'edit'
                                                            }
                                                        }
                                                    }, '修改'),
                                                    // h('Divider', {props: {type: 'vertical'}}, ''),
                                                ]);
                                            }
                                        },{title: '填报时间', align: 'center', key: 'createDate', width: 100, render: this.renderCellDate},
                                        {title: '进展说明', align: 'center', key: 'progressDesc', minWidth: 100,},
                                        {title: '下一步计划', align: 'center', key: 'planDesc', minWidth: 100,},
                                    ],//表头
                                    data: params.row.progressList,//内部表格展示的数据
                                },
                            })
                        }
                    },
                    {title: '序号', width: 65, align: 'center', render:this.indexColumnsRender},
                    { key:'stateDesc',title: '当前状态',  align: 'center', minWidth: 90,
                        render: (h, params) => {
                            return  h('span', {
                                style: {
                                    fontSize: '12px',
                                    color: params.row.state === "OPEN" ? 'blue' : params.row.state === "START"?'red':'',
                                }
                            }, params.row.stateDesc)
                        }},
                    { key:'gradingDesc',title: '督办',  align: 'center', minWidth: 90,
                        render: (h, params) => {
                            return  h('span', {
                                style: {
                                    fontSize: '12px',
                                    color: params.row.grading === "FOCUS_ON" ? 'red' : params.row.grading === "FOLLOW"?'#FFB826':'',
                                }
                            }, params.row.gradingDesc)
                        }},
                  // { key:'gradingUserName',title: '督办人',  align: 'center', minWidth: 90,  },
                  {title: '评价项目', key: 'project', align: 'center', width: 90},
                  {title: '评价内容', key: 'content', align: 'center', width: 120, tooltip: true},
                  {title: '评分标准', key: 'standard', align: 'center', width: 120, tooltip: true},
                  {key: 'problemDesc', title: '问题描述', align: 'center', minWidth: 200, tooltip: true},
                  {key: 'problemCategoryName', title: '问题类别', align: 'center', minWidth: 120},
                  // { key:'checkLevelDesc',title: '检查级别',  align: 'center', minWidth: 110,  },
                  {key: 'rectifyPlan', title: '整改方案', align: 'center', minWidth: 120, tooltip: true},
                  {key: 'checkTime', title: '检查时间', align: 'center', minWidth: 120, render: this.renderCellDate},
                  {key: 'completeTime', title: '完成时限', align: 'center', minWidth: 120, render: this.renderCellDate},
                  {key: 'completion', title: '当前进展描述', align: 'center', minWidth: 120, tooltip: true},
                  {key: 'rectifyUserName', title: '整改人', align: 'center', minWidth: 100,},
                  {
                    title: '操作',
                    key: 'action',
                    fixed: 'right',
                    width: 240,
                    align: 'center',
                    render: (h, params) => {
                      return h('div', [
                        h('A', {
                                    props: {type: 'primary', size: 'small'},
                                    style: {
                                        fontSize: '14px',
                                        color: params.row.state!=='OPEN'? '' :  '#d0d0d0',
                                        pointerEvents: params.row.state!=='OPEN' ? '' : 'none'
                                    },
                                    on: {
                                        click: () => {
                                            let dataToExtension = {...params.row};
                                            this.dataToExtension = {
                                                completeTime:dataToExtension.completeTime,
                                                questionId:dataToExtension.id,
                                            };
                                            this.modal4 = true;
                                        }
                                    }
                                }, '问题延期'),
                                h('Divider', {props: {type: 'vertical'}}, ''),
                                h('A', {
                                    props: {type: 'primary', size: 'small'},
                                    style: {
                                        fontSize: '14px',
                                        color: params.row.state==='OPEN'? '#d0d0d0' :  '',
                                        pointerEvents: params.row.state==='OPEN' ? 'none' : ''
                                    },
                                    on: {
                                        click: () => {
                                            this.editData(params);
                                        }
                                    }
                                }, '整改'),
                                h('Divider', {props: {type: 'vertical'}}, ''),
                                h('A', {
                                    props: {type: 'primary', size: 'small'},
                                    style: {
                                        fontSize: '14px',
                                        color: params.row.grading === "NO_FOLLOW"|| params.row.state==='OPEN'? '#d0d0d0' :  '',
                                        pointerEvents:  params.row.grading === "NO_FOLLOW"|| params.row.state==='OPEN' ? 'none' : ''
                                    },
                                    on: {
                                        click: () => {
                                            this.questionProgress.accountId=params.row.id
                                            this.model2 =true
                                            this.mode= 'add'
                                        }
                                    }
                                }, '督办问题进展'),
                            ]);
                        }
                    }
                ],
                ruleCustom: {
                    state: [{required: true, message: '请选择整改状态', trigger: 'change'}],
                    completion: [{required: true, message: '请选择完成情况', trigger: 'change'}],
                    rectifyPlan: [{required: true, message: '请填写整改方案', trigger: 'change'}],
                    rectifyUserId: [{required: true, message: '请选择整改人', trigger: 'change'}],
                },

                currentUser: JSON.parse(sessionStorage('userId').get('userId')),
                queryUrl: Api.queryAnnProRectify.replace('list','questionList'),
                updateUrl: Api.updateQuestionAccount,
                setCurrentUserName:{},
                ruleCustom1: {
                    progressDesc:[{required: true, message: '  ', trigger: 'change'}],
                    planDesc:[{required: true, message: '  ', trigger: 'change'}]
                },
                model2:false,
                questionProgress:{},
                //督办问题
                updateProgress: Api.updateProgress,
                deleteProgress: Api.deleteProgress,
                saveProgress: Api.saveProgress,

                options: {
                    disabledDate (date) {
                        return date && date.valueOf() <= Date.now();
                    },
                },
                modal4: false,
                modal5: false,
                loadingExtension:false,
                dataToExtension:{},
                extensionShow:{
                    userId: [{required: true, message: '请选择审批人', trigger: 'change'}],
                    explain: [{required: true, message: '请填写延期申请', trigger: 'change'}],
                    completeTime: [{
                        validator: (rule, value, callback) => {
                            if (value == null || value == '' || value == undefined) {
                                callback(' ')
                            } else {
                                callback()
                            }
                        },
                        required: true,
                        trigger: 'change'
                    }],
                },
            }

        },
        async mounted() {
            this.setTableHeight();
            this.$http.get(Api.queryCodeDetailBySortId + '/NOT-00006', {params: {}}).then((res) => {
                this.environmentProtectionList = res.data.data;
            });
            if (this.$route.query.businessId) {
                this.dataToQuery.businessId = this.$route.query.businessId
            }
            this.query()
        },
        methods: {
            ...pageCommonFunction,
            getSelectModelData(row) {
                this.dataToExtension.userId = row.userId;
                this.dataToExtension.userName = row.userName;
                this.modal5 = false;
            },
            submitExtension(name){
                let _this = this;
                this.$refs[name].validate((valid) => {
                    if (valid) {
                        _this.loadingExtension = true;
                        let url = Api.extensionEnProQuestionAccount;
                        this.$http.post(url, _this.dataToExtension).then((res) => {
                            if (res.data.status == '200'){
                                _this.$Message.success("上报成功")
                                _this.query()
                                _this.modal4 = false;
                            }else{
                                this.$Message.error(res.data.msg);
                            }
                            _this.loadingExtension = false;
                        }).catch(e=>{
                            console.log(e)
                        })
                    } else {
                        this.$Message.error('请填报完整!');
                    }
                })
            },
            goBack() {
                // this.$router.back();
                this.$router.go(-1);
            },
            query() {
                // this.queryAjax();
                this.pageStatus.loading = true
                this.$http.get(this.queryUrl+'/'+ this.$route.query.id+'/'+ this.$route.query.type,{params: this.dataToQuery}).then((res) => {
                    if (res.data.status === 201) {
                        this.$Message.error(res.data.msg);
                    }
                    if (this.dataToQuery.businessId) {
                        this.dataTable = res.data.data.filter(m=>m.questionId===this.dataToQuery.businessId);
                    }else {
                        this.dataTable = res.data.data
                    }
                    this.pageStatus.loading = false
                }).catch(e => {
                    this.$Message.error("数据获取失败")
                    this.pageStatus.loading = false
                })
            },
            submit(name) {
                let data = {
                    id:this.dataToView.questionId,
                    companyId:this.dataToView.companyId,
                    completion:this.dataToView.completion,
                    rectifyPlan:this.dataToView.rectifyPlan,
                    rectifyUserId:this.dataToView.rectifyUserId,
                    state:this.dataToView.state,
                    completeTime: this.dataToView.completeTime,
                    finishTime: this.dataToView.state == 'OPEN'?new Date():this.dataToView.state == 'START'?null:this.dataToView.finishTime
                }
                // this.mode = this.dataToView.mode
                if (this.pageStatus.sending) return
                this.$refs[name].validate((valid) => {
                    if (valid) {
                        this.$Modal.confirm({
                            title: '提示',
                            content: '<p>整改状态标记为已完成后不能继续修改数据，是否继续提交？</p>',
                            onOk: () => {
                                let url = this.mode === 'add' ? this.saveUrl : this.updateUrl;
                                this.pageStatus.sending = true
                                let successHandle = (res) => {
                                    if (res.data.status === 200) {
                                        this.$Message.success(this.mode === 'add' ? '添加成功' : '修改成功');
                                        this.dialogShow = false;
                                        this.query()
                                    } else if (res.data.status === 201) {
                                        this.$Message.error(res.data.msg);
                                    }
                                    this.pageStatus.sending = false
                                }
                                let failedHandle = e => {
                                    this.$Message.error(this.mode === 'add' ? '添加失败' : '修改失败')
                                    this.pageStatus.sending = false
                                }
                                if (this.mode === 'add') {
                                    this.$http.post(url, data).then(successHandle).catch(failedHandle)
                                } else {
                                    this.$http.put(url, data).then(successHandle).catch(failedHandle)
                                }
                            },
                            onCancel: () => {
                            }
                        });
                    } else {
                        this.$Message.error('请填报完整!');
                    }
                })
            },

            onExpand(row, status){
                if(status){
                    this.dataTable.splice()
                    this.dataTable.filter((item, index)=>{
                        if(item.id == row.id){
                            item._expanded = true;   //展开选中的行
                        }else{
                            item._expanded = false;   //其他行关闭
                        }
                        return item;
                    });
                }else{
                    this.dataTable.splice()
                    this.dataTable.map((item, index)=>{
                        if(item.id == row.id){
                            item._expanded = false;   //展开选中的行
                        }else{
                            item._expanded = false;   //其他行关闭
                        }
                        return item;
                    });
                }
            },
            submit1(name) {
                // this.submitAjax(name,this.questionProgress);
                if (this.pageStatus.sending) return
                this.$refs[name].validate((valid) => {
                    if (valid) {
                        this.$Modal.confirm({
                            title: '提示',
                            content: '<p>是否要提交？</p>',
                            onOk: () => {
                                let url = this.mode === 'add' ? this.saveProgress : this.updateProgress;
                                this.pageStatus.sending = true
                                let successHandle = (res) => {
                                    if (res.data.status === 200) {
                                        this.$Message.success(this.mode === 'add' ? '添加成功' : '修改成功');
                                        this.model2 = false;
                                        this.query()
                                    } else if (res.data.status === 201) {
                                        this.$Message.error(res.data.msg);
                                    }
                                    this.pageStatus.sending = false
                                }
                                let failedHandle = e => {
                                    this.$Message.error(this.mode === 'add' ? '添加失败' : '修改失败')
                                    this.pageStatus.sending = false
                                }
                                if (this.mode === 'add') {
                                    this.$http.post(url, this.questionProgress).then(successHandle).catch(failedHandle)
                                } else {
                                    this.$http.put(url, this.questionProgress).then(successHandle).catch(failedHandle)
                                }
                            },
                            onCancel: () => {
                            }
                        });
                    } else {
                        this.$Message.error('请填报完整!');
                    }
                })
            },
            async afterDataToViewInit() {
                await this.getFiles1('id', 'EnQuestionDetailForApproval');
                this.dataToView.state = this.dataToView.state==='NOT_RECTIFIED'? 'START':this.dataToView.state
                this.setCurrentUserName = { name: this.dataToView.rectifyUserName};
            },
            editEcho(){
                this.$refs.userDom.setCurrentInfo();
            }
        },
        watch: {
            'dataTable': function () {
                this.dataTable.forEach(m=>{
                    if (m.grading === 'NO_FOLLOW') {
                        m['_disableExpand'] = true
                    }
                })
            }
        }
    }
</script>

<style scoped>
    .rpt-form {
    }

    /deep/ .rpt-form .query-form-el {
        width: 100%;
    }
</style>
